package concurrency;

/**
 * @Author DRevelation
 * @Date 2020-06-15 下午 13:54
 * @Desc
 */
public class ThreadStateDemo extends Thread {
    @Override
    public void run() {
        System.out.println("Thread State-" + Thread.currentThread().getState());
    }

    public static void main(String[] args) {
        Thread thread = new ThreadStateDemo();
        System.out.println("Thread State-" + thread.getState());

        try {
            Thread.sleep(1000);
            System.out.println("Thread State-" + thread.getState());
            thread.start();
            Thread.sleep(1000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        System.out.println("Thread State-" + thread.getState());
    }
}
